@extends('home.frame')

@section('content')

<link href="/ho/css/infstyle.css" rel="stylesheet" type="text/css">
<link href="/ho/css/personal.css" rel="stylesheet" type="text/css">
<script src="/ho/My97DatePicker/WdatePicker.js"></script>
<style>
	.am-form-label{
		width:60px;
	}
</style>
				<div class="user-info">
						<!--标题 -->
						<div class="am-cf am-padding">
							<div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">个人资料</strong> / <small>Personal&nbsp;information</small></div>
						</div>
						<hr/>

						<!--头像 -->
						<div class="user-infoPic">

							<div class="filePic">
								<img class="am-circle am-img-thumbnail" src="/ho/images/getAvatar.do.jpg" alt="" />
							</div>

							<div class="info-m">
								<div><b>用户名：<i>{{$user->uname}}</i></b></div>
								<div class="u-level">
									<span class="rank r2">
							             <s class="vip1"></s><a class="classes" href="#">会员等级：{{$userinfo->uf_vstatus}}</a>
						            </span>
								</div>
								<div class="u-level">
									<span class="rank r2">
							             <s class="vip1"></s><a class="classes" href="#">积分：{{$userinfo->ufscore}}</a>
						            </span>
								</div>
							</div>
						</div>
						
						@if(is_object($errors) && count($errors) > 0)
		                  <div style="color:red;" class="one" onclick="$(this).css('display','none')">
		                    验证失败：
		                      <ul>
		                          @foreach ($errors->all() as $error)
		                              <li>{{ $error }}</li>
		                          @endforeach
		                      </ul>
		                  </div>
		              @elseif(is_string($errors))
		                <div style="color:red;" class="one" onclick="this.style.display='none'">
		                    验证失败：
		                      <ul>
		                        <li>{{$errors}}</li>
		                      </ul>
		                  </div>
		              @endif
		              @if(session('success'))
		              	<div style="color:green;" class="one" onclick="this.style.display='none'">
		                      <ul>
		                        <li>{{ session('success')}}</li>
		                      </ul>
		                  </div>
		              @endif
						<!--个人信息 -->
						<div class="info-main">
							<form class="am-form am-form-horizontal" action="/home/userinfo/update?uid={{$user->uid}}" method="post">
								{{csrf_field()}}
								<div class="am-form-group">
									<label for="user-name2" class="am-form-label">用户名</label>
									<div class="am-form-content">
										@if($user->uname == $user->uphone || $user->uname == $user->uemail)
										<input type="text" id="user-name2" name="uname" value="{{$user->uname}}">
										<font style="color:red">用户名可用于登录，仅可修改一次</font>
										@else
										<input type="text" id="user-name2" name="uname" value="{{$user->uname}}" readonly>
										@endif
									</div>
								</div>

								<div class="am-form-group">
									<label for="user-name" class="am-form-label">真实姓名</label>
									<div class="am-form-content">

										<input type="text" id="user-name2" name="ufname" value="{{$userinfo->ufname}}">

									</div>
								</div>

								<div class="am-form-group">
									<label class="am-form-label">性别</label>
									<div class="am-form-content sex">
										<label class="am-radio-inline">
											<input type="radio" name="ufsex" value="m" data-am-ucheck {{ $userinfo->ufsex=='m' ? 'checked' : '' }}> 男
										</label>
										<label class="am-radio-inline">
											<input type="radio" name="ufsex" value="w" data-am-ucheck {{ $userinfo->ufsex=='w' ? 'checked' : '' }}> 女
										</label>
									</div>
								</div>

								<div class="am-form-group">
									<label for="user-birth" class="am-form-label">生日</label>
									<div class="am-form-content birth">
											<input type="text" class="Wdate birth-select" onClick="WdatePicker()" name="ufbirthday" value="{{$userinfo->ufbirthday}}">
									</div>
							
								</div>
								<div class="am-form-group">
									<label for="user-phone" class="am-form-label">电话</label>
									<div class="am-form-content">
										<input id="user-phone" value="{{$user->uphone}}" type="text" readonly>

									</div>
								</div>
								<div class="am-form-group">
									<label for="user-email" class="am-form-label">电子邮件</label>
									<div class="am-form-content">
										<input id="user-email" value="{{$user->uemail}}" type="email" readonly>
									</div>
								</div>
								<div class="info-btn">
									<button class="am-btn am-btn-danger">保存修改</button>
								</div>

							</form>
						</div>

					</div>

@endsection
